
#include "../common.h"

int main(int argc, char** argv)
{
	int fd;
	char *p = "123";
	
	if(-1 == (fd = open(argv[1], O_RDWR)))
	{
		printf("fopen failed\n");
		return -1;
	}

	printf("test writelock=[%d]\n", fd_is_writelock(fd, 0, SEEK_SET, 0));	
	printf("test readlock=[%d]\n", fd_is_readlock(fd, 0, SEEK_SET, 0));	
	
	printf("write [%d][%s]\n", write(fd, p, 2), strerror(errno));	
	
	//close(fd);

	return 0;
}
